import { createApp } from 'vue';
// 导入路由配置
import { router } from './router/index.js';
// 导入pinia
import { createPinia } from 'pinia';

// 导入饿了么ui
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';

// 导入图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

import App from './App.vue';

const app = createApp(App);

// 使用路由
app.use(router);
// 使用饿了么ui
app.use(ElementPlus, { locale: zhCn });
// 使用pinia
app.use(createPinia());

// 使用图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.mount('#app');
